# !/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@Time        : 2021/10/27 18:18
@Author      : Albert Darren
@Contact     : 2563491540@qq.com
@File        : sharp_im2.py
@Version     : Version 1.0.0
@Description : TODO
@Created By  : PyCharm
"""
from skimage.io import imread
from skimage.filters import unsharp_mask
from DIP_experiment_5.util import contrast_show

# 以灰度图形式读入图像
im_path = "../experiment_fig/beans.png"
im = imread(im_path,as_gray=True)
im_dict = {}
for radius in range(1, 5):
    amount = 1 << radius
    sharp_im = unsharp_mask(im, amount=amount, radius=radius)
    im_dict["radius={} amount={}".format(radius, amount)] = sharp_im
contrast_show(im_dict,(2,2),hspace=0.3)
